package com.itheima.d4_proxy;

public class Demo01 {
    public static void main(String[] args) {
        Wang wang=new Wang();
        Song song=new Song(wang);
        song.getShow(100000);
        song.sleep();
    }
}

interface star{
    double getShow(double money);

    void sleep();
}

class Wang implements star{

    @Override
    public double getShow(double money) {
        System.out.println("Wang赚了"+money+"元");
        return money;
    }

    @Override
    public void sleep() {
        System.out.println("Wang库库睡觉");
    }
}

class Song implements star{
    private Wang wang;
    public Song(Wang wang){
        this.wang=wang;
    }

    @Override
    public double getShow(double money) {
        System.out.println("Song给Wang炒股了，赚了"+money*2);
        wang.getShow(money*2);
        return money*2;
    }

    @Override
    public void sleep() {
        System.out.println("Song给Wang定了酒店");
        wang.sleep();
        System.out.println("Song退房");
    }
}
